//-----------------------------------------------------------------------------
// SpriteBatch.fx
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------


sampler BaseTexture : register(s0);

struct PixelToFrame
{
    float4 Color : COLOR0;
};

PixelToFrame SpritePixelShader(float4 position : POSITION, float2 texcoords : TEXCOORD0)
{
	PixelToFrame Output = (PixelToFrame)0;
	
	float2 deltaX = float2(float(1) / 1024,0);
	float2 deltaY = float2(0,float(1) / 768);

	float4 color = float4(0,0,0,1);

	int i = 0;
	for(i = -1; i < 2; i++)
	{
		color += tex2D(BaseTexture,texcoords + i * deltaX);
	}
	for(i = -1; i < 2; i++)
	{
		color += tex2D(BaseTexture,texcoords + i * deltaY);
	}
	
	color -= tex2D(BaseTexture,texcoords);

	color /= 5;
	
	Output.Color = color;
	return Output;
}


technique SpriteBatch
{
	pass
	{
		PixelShader  = compile ps_2_0 SpritePixelShader();
	}
}
